WOLF core
WOLF: A Modular Estimation Framework for Robotics
XXXXXXXXXXXXXXXXXXXXXXXXvoid(0)" frameborder="0" name="MSearchResults" id="MSearchResults">
graph_search.h
Go to the documentation of this file.
1// WOLF - Copyright (C) 2020-2026
2// Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
3// Authors: Joan Solà Ortega (jsola@iri.upc.edu) and
4// Joan Vallvé Navarro (jvallve@iri.upc.edu)
5// All rights reserved.
6//
7// This file is part of WOLF: http://www.iri.upc.edu/wolf
8// WOLF is free software: you can redistribute it and/or modify
9// it under the terms of the GNU General Public License version 3
10// as published by the Free Software Foundation.
11//
12// This program is distributed in the hope that it will be useful,
13// but WITHOUT ANY WARRANTY; without even the implied warranty of
14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15// GNU General Public License for more details.
16//
17// You should have received a copy of the GNU General Public License
18// along with this program. If not, see <http://www.gnu.org/licenses/>.
19#pragma once
20
21#include "core/common/wolf.h"
24
25#include <map>
26
27namespace wolf
28{
32{
33 private:
36 std::map<NodeStateBlocksPtr, std::pair<FactorBasePtr, NodeStateBlocksPtr>> parents_;
37
38 public:
42
46
50 FactorBasePtrList computeShortestPath(NodeStateBlocksPtr node1,
51 NodeStateBlocksPtr node2,
52 const unsigned int max_graph_dist = 0);
53
56 std::set<NodeStateBlocksPtr> getNeighborFrames(const std::set<NodeStateBlocksPtr>& nodes);
57
60 static FactorBasePtrList shortestPath(NodeStateBlocksPtr node1,
61 NodeStateBlocksPtr node2,
62 const unsigned int max_graph_dist = 0)
63 {
64 GraphSearch graph_search;
65
66 return graph_search.computeShortestPath(node1, node2, max_graph_dist);
67 }
68};
69
70} // namespace wolf
Breadth-first search of the shortest path of factors between two nodes of the factor graph.
Definition: graph_search.h:32
static FactorBasePtrList shortestPath(NodeStateBlocksPtr node1, NodeStateBlocksPtr node2, const unsigned int max_graph_dist=0)
Computes the shortest path of factors between two nodes (see computeShortestPath())
Definition: graph_search.h:60
FactorBasePtrList computeShortestPath(NodeStateBlocksPtr node1, NodeStateBlocksPtr node2, const unsigned int max_graph_dist=0)
Computes the shortest path of factors between two nodes, up to a graph distance (0: unlimited)....
Definition: graph_search.cpp:27
std::set< NodeStateBlocksPtr > getNeighborFrames(const std::set< NodeStateBlocksPtr > &nodes)
Returns the not visited nodes sharing a factor with some nodes, storing their parents.
Definition: graph_search.cpp:70
~GraphSearch()
Destructor.
Definition: graph_search.cpp:25
GraphSearch()
Default constructor.
Definition: graph_search.cpp:23
Definition: capture_base.h:23